<template>
  <div class="new_i w-all">
    <div class="new_i_img_box dis-flex flex-x-center">
      <img
        src="/static/imgs/logo(透明).png"
        alt
        class="new_i_img_box_img"
      />
    </div>
    <div class="new_i_title_box" id="productId0">木伯乐简介</div>
    <div class="new_i_center_box">{{topData}}</div>
    <div class="new_i_title_box" id="productId1">基本信息</div>
    <div class="new_i_basic dis-flex flex-y-center" v-for="item in listBasic" :key="item.name">
      <div style="color:#999">{{item.name}}</div>
      <div>{{item.center}}</div>
    </div>
    <div class="new_i_title_box" id="productId2">装饰板材</div>
    <div class="dis-flex flex-x-center m-top20">
      <img
        class="new_i_material"
        src="/static/imgs/水木清华.jpg"
        alt
      />
    </div>
    <div class="new_i_material_font m-top20">{{materialData}}</div>
    <div class="new_i_title_box" id="productId3">获奖荣誉</div>
    <div class="new_i_material_font">{{honorData}}</div>
    <div class="new_i_material_font2" v-for="(item,index) in honorDataList" :key="index">{{item}}</div>
    <div class="new_i_title_box" id="productId4">公司图片</div>
    <div class="dis-flex flex-x-center m-top20">
      <img
        class="new_i_material"
        src="/static/imgs/木伯乐.png"
        alt
      />
    </div>
      <div class="dis-flex flex-x-center m-top20">
      <img
        class="new_i_material"
        src="/static/imgs/办公室.gif"
        alt
      />
    </div>
    <div class="new_i_title_box" id="productId5">公司地址</div>
    <div class="dis-flex flex-x-center m-top20">
      <img
        class="new_i_material"
        src="/static/imgs/地图.png"
        alt
      />
    </div>
    <div class="dis-flex flex-x-center new_i_bottom_font">
      <p class="f-bottom2 visible-xs f_b"> <a class="a" href="http://beian.miit.gov.cn">Copyright &copy; 2018-2020 木伯乐全屋定制 版权所有  赣ICP备19007009-2号
      </a></p></div>
    <publiChoice @clickFlag="handleShow"></publiChoice>
    <van-popup v-model="show" round class="new_i_popup">
      <div class="new_i_popup_title">词条目录</div>
      <!-- #productId   :src="`${FTP_HOST}${info.response[0].url}`"-->
      <div
        class="new_i_popup_center"
        v-for="(item,index) in directoryList"
        :key="index"
        @click="handleJumpPage('#productId',index)"
      >{{item}}</div>
      <div class="new_i_popup_colse" @click="handleShow(false)">关闭</div>
    </van-popup>
  </div>
</template>

<script>
import {
  getTopData,
  getInTheBasicData,
  getMaterialData,
  getHonorData,
  getHonorDataList,
  getGroupData,
  getAddressData,
  getDirectoryData
} from "@/utils/newIndexData";
import publiChoice from "@/framework/common/components/publicChoice.vue";
import { Popup } from "vant";
export default {
  name: "",

  mixins: [],

  components: {
    publiChoice,
    [Popup.name]: Popup
  },

  props: {},

  data() {
    return {
      topData: "",
      groupData: "",
      addressData: "",
      materialData: "",
      directoryList: [],
      honorDataList: [],
      honorData: "",
      listBasic: [],
      show: false
    };
  },

  computed: {},

  watch: {},

  created() {
    this.topData = getTopData();
    this.listBasic = JSON.parse(getInTheBasicData());
    this.materialData = JSON.parse(getMaterialData());
    this.honorData = JSON.parse(getHonorData());
    this.honorDataList = JSON.parse(getHonorDataList());
    this.directoryList = JSON.parse(getDirectoryData());
  },

  mounted() {},

  destroyed() {},

  methods: {
    handleShow(data) {
      this.show = data;
    },
    handleJumpPage(name, index) {
      // console.log(name)
      console.log(name + index);
      let flag = name + index;
      document.querySelector(flag).scrollIntoView(true);
      this.show = false;
    }
  }
};
</script>

<style lang="less">
.new_i {
  padding: 20px 30px;
  &_popup {
    border-radius: 20px;
    padding: 20px;
    box-sizing: border-box;
    width: 90%;
    color: #222;
    &_colse {
      text-align: center;
      padding: 20px 0;
      font-size: 15px;
      font-weight: bold;
      color: #4110e6;
    }

    &_center {
      padding: 10px 15px;
      font-size: 14px;
      background: #f8f8f8;
      margin-bottom: 15px;
      border-radius: 10px;
      font-weight: bold;
    }
    &_title {
      margin-bottom: 20px;
      font-size: 20px;
      line-height: 28px;
    }
  }
  &_bottom_font {
    padding: 16px 0;
    font-size: 12px;
    margin-bottom: 12px;
    color: #222;
    line-height: 20px;
  }
  &_material {
    width: 200px;
    height: 150;
    border-radius: 10px;
    &_font {
      line-height: 30px;
      color: #222;
      font-size: 15px;
    }
    &_font2 {
      line-height: 50px;
      color: #222;
      font-size: 15px;
    }
  }
  &_basic {
    margin-bottom: 12px;
    line-height: 28px;
    font-size: 15px;
    color: #222;
  }
  &_center_box {
    line-height: 30px;
    font-size: 15px;
  }
  &_title_box {
    font-size: 23px;
    line-height: 26px;
    color: #222;
    font-weight: 600;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  &_img_box {
    overflow: hidden;
    padding-bottom: 30px;
    width: 100%;

    &_img {
      border-radius: 16px;
      height: 181.343px;
    }
  }
}
</style>
